
<template>
  <div>
    <guess
      v-if="list !== '' && $route.query.link !== 'teachers'"
      :guessList="list"
      :clas="obj.money_type"
      v-on:jiaoyudetail="jiaoyudetail"
    >
    </guess>
    <teacher-list v-else :type="list" :clas="obj.money_type"></teacher-list>
  </div>
</template>

<script>
import { getotherlist } from '@/api/assemble'
import teacherList from '@/components/index/teacherlist1'
import guess from '@/components/index/guess'
export default {
  created () {
    this.obj.money_type = this.$route.query.link
    this.otherlist()
  },
  components: {
    guess,
    teacherList
  },
  data () {
    return {
      obj: {
        money_type: 'one_money'
      },
      list: {
        educationLIST: ''
      }
    }
  },
  methods: {
    otherlist () {
      getotherlist(this.obj).then(res => {
        let { code, data } = res.data
        if (code === 200) {
          this.list.educationLIST = data
          // console.log(this.list)
          this.$store.commit('updateLoadingStatus', { isLoading: false })
        }
      })
    },
    // 课程详情
    jiaoyudetail (item) {
      if (item) {
        if (window.__wxjs_is_wkwebview !== true) {
          this.$router.push({
            path: '/coursedetails',
            query: {
              curriculumId: item.curriculum_id
            }
          })
        } else {
          window.location.href = `/coursedetails?curriculumId=${item.curriculum_id}`
        }
      }
    }
  }
}
</script>

<style>
</style>
